# -*- coding: utf-8 -*-
N=int(raw_input().strip())
ins=raw_input().strip().split(' ')
total_sum=0
valid_count=0
for e in ins:
    try:
        num = float(e)
        if num > 1000 or num < -1000:
            print 'ERROR: '+e+' is not a legal number'
            continue
        if '.' in e and len(e.split('.')[-1])>2:
            print 'ERROR: '+e+' is not a legal number'
            continue
        valid_count+=1
        total_sum+=num
    except:
        print 'ERROR: '+e+' is not a legal number'

if valid_count > 1:
    print 'The average of %d numbers is %.2f'%(valid_count, total_sum/valid_count)
elif valid_count == 1:
    print 'The average of 1 number is %.2f'%total_sum
else:
    print 'The average of 0 numbers is Undefined'